﻿using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace PTTPOS_Solution.DAL
{
    public static class Order_DA
    {
        public static void AppendOrder(string id_order)
        {
            MySqlCommand com = new MySqlCommand("insert into tblorders(id_customer,id_staff, id_table, id_surcharge, id_discount, Orderdate, total_surcharge, total_discount, total_price) select id_customer,id_staff, id_table, id_surcharge, id_discount, Orderdate, total_surcharge, total_discount, total_price from tblorders_pro where id = @id_order", Connection_PTTPOS.GetConnection());
            com.Parameters.AddWithValue("@id_order", id_order);
            com.Connection.Open();
            com.ExecuteNonQuery();
            com.Connection.Close();
        }
    }
}
